﻿<phone:PhoneApplicationPage 
    x:Class="AllTalk.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:scm="clr-namespace:System.ComponentModel;assembly=System.Windows"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768" 
    d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <!--Pivot Control-->
        <controls:Pivot Title="All Talk" Name="MainPivot">
            <!--Pivot item one-->
            <controls:PivotItem Header="gtalk">
                <!--Double line list with text wrapping-->
                <ListBox x:Name="FriendsList" Margin="0,0,-12,0" ItemsSource="{Binding FriendViewModels}" SelectionChanged="FriendsList_SelectionChanged" >
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Grid Margin="0,0,0,17" Width="432" >
                                <Grid.ColumnDefinitions >
                                    <ColumnDefinition Width="50"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="50"/>
                                </Grid.ColumnDefinitions>
                                <Image Grid.Column="0" Stretch="Uniform" Source="{Binding Image}"></Image>
                                <StackPanel Grid.Column="1">
                                    <TextBlock Text="{Binding Name}" TextWrapping="NoWrap" Style="{StaticResource PhoneTextLargeStyle}"/>
                                    <TextBlock Text="{Binding StatusMessage}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                                </StackPanel>
                                <TextBlock Grid.Column="2" Text="{Binding Presence}"></TextBlock>
                                <!--<Image Grid.Column="2" Source="{Binding Status}"></Image>-->
                            </Grid>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="False" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Chat" Click="ApplicationBarIconButton_Click" />
            <shell:ApplicationBarIconButton IconUri="/Images/appBar.email.png" Text="Mail"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->
    <phone:PhoneApplicationPage.Resources>
    <!--    <CollectionViewSource
          x:Key="Friends" 
          Source="{Binding FriendViewModels}"
          >
            <CollectionViewSource.SortDescriptions>
                <scm:SortDescription PropertyName="Status" Direction="Descending" />
            </CollectionViewSource.SortDescriptions>
        </CollectionViewSource>-->
    </phone:PhoneApplicationPage.Resources>
</phone:PhoneApplicationPage>
